//
//  CMDBSocialButton.swift
//  CMDB
//
//  Created by 曹桂祥 on 17/4/13.
//  Copyright © 2017年 CMDB. All rights reserved.
//

import UIKit

class CMDBSocialButton: UIButton {
    
    var numLabel : UILabel!
    
    var nameLael : UILabel!
    
    required override init(frame: CGRect) {
        super.init(frame: frame)
        
        buildSubViews()
    }
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }


    override func buildSubViews() {
        super.buildSubViews()
        
        nameLael = UILabel()
        
        nameLael.font = CMDB_12_FONT
        
        nameLael.textAlignment = .Center
        
        nameLael.textColor = UIColor.whiteColor()
        
        nameLael.text = "关注"
        
        nameLael.sizeToFit()
        
        addSubview(nameLael)

        
        numLabel = UILabel()
        
        numLabel.font = CMDB_13_FONT
        
        numLabel.textColor = UIColor.whiteColor()
        
        numLabel.text = "000"
        
        numLabel.textAlignment = .Center
        
        numLabel.sizeToFit()
        
        addSubview(numLabel)
        
    }
    
    override func layoutSubviews() {
        super.layoutSubviews()
        
        nameLael.centerX = bounds.size.width * 0.5
        
        nameLael.y      = 5
        
        numLabel.centerX    = bounds.size.width * 0.5
        
        numLabel.y         = CGRectGetMaxY(nameLael.frame) + 5
    
    }
    
    

}
